<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑会员</title>
    <link rel="stylesheet" href="__PEAR__/component/pear/css/pear.css" />
</head>
<body>
<form class="layui-form" action="">
    <div class="mainBox">
        <div class="main-container">
            <div class="main-container">
            
            		<div class="layui-form-item ">
                  	<div class="layui-col-md12">
					    <label class="layui-form-label">会员等级</label>
					    <div class="layui-input-inline">
					      <select name="level">
					      			<option value="">请选择等级</option>
									{volist name="levels" id="vo"}
									<option {if condition="$vo['lid'] eq $one['level']"} selected="selected"{/if} value="{$vo['lid']}">{$vo['levelname']}</option>
									{/volist}
							</select>
					    </div>
				    </div>
				  </div>
                  <div class="layui-form-item">
				    <label class="layui-form-label">会员名称</label>
				    <div class="layui-input-inline">
				      <input type="text" name="uname" value="{$one['uname']}" {present name="one"}readonly="readonly"{/present} required  lay-verify="required" placeholder="请输入唯一的会员名称" autocomplete="off" class="layui-input">
				    </div>
				  </div>
                  <div class="layui-form-item">
				    <label class="layui-form-label">会员编码</label>
				    <div class="layui-input-inline">
				      <input type="text" name="ucode" value="{$one['ucode']}" required  lay-verify="required" placeholder="请输入唯一的会员编码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">真实名称</label>
				    <div class="layui-input-inline">
				      <input type="text" name="nickname" value="{$one['nickname']}" placeholder="请输入昵称或真实名称" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">登录密码</label>
				    <div class="layui-input-inline">
				      <input type="password" name="passwd" value="" placeholder="请输入登录密码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">确认密码</label>
				    <div class="layui-input-inline">
				      <input type="password" name="passwd2" value="" placeholder="请输入二次确认密码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
			
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">会员状态</label>
				    <div class="layui-input-inline">
				      <input type="radio" name="status"  value="1" {if condition="$one['status'] eq 1 OR empty($one)"} checked="checked"{/if} title="正常" >
						<input type="radio" name="status" value="2" {if condition="$one['status'] eq 2 AND !empty($one)"} checked="checked"{/if} title="冻结">
				    </div>
				  </div>
				  
  		  		<div class="layui-form-item">
				    <label class="layui-form-label">账户余额</label>
				    <div class="layui-input-inline">
				      <input type="text" name="account" value="{$one['account']}" placeholder="请输入数字" autocomplete="off" class="layui-input">
				    </div>
				 </div>
				 
				 <div class="layui-form-item">
				    <label class="layui-form-label">冻结余额</label>
				    <div class="layui-input-inline">
				      <input type="text" name="frozen_account" value="{$one['frozen_account']}" placeholder="请输入数字" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">会员积分</label>
				    <div class="layui-input-inline">
				      <input type="text" name="credit" value="{$one['credit']}" placeholder="请输入数字" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">微信OPENID</label>
				    <div class="layui-input-inline">
				      <input type="text" name="openid" value="{$one['openid']}" placeholder="微信会员唯一标识" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">微信号码</label>
				    <div class="layui-input-inline">
				      <input type="text" name="wechat" value="{$one['wechat']}" placeholder="会员的微信号" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">手机号码</label>
				    <div class="layui-input-inline">
				      <input type="text" name="mobile" value="{$one['mobile']}" placeholder="会员的手机号码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">电话号码</label>
				    <div class="layui-input-inline">
				      <input type="text" name="phone" value="{$one['phone']}" placeholder="会员的其他联系方式" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  <div class="layui-form-item">
				    <label class="layui-form-label">电子邮箱</label>
				    <div class="layui-input-inline">
				      <input type="text" name="email" value="{$one['email']}" placeholder="会员的邮箱地址" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">联系地址</label>
				    <div class="layui-input-inline">
				      <input type="text" name="address" value="{$one['address']}" placeholder="会员的收件地址" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">QQ号码</label>
				    <div class="layui-input-inline">
				      <input type="text" name="qq" value="{$one['qq']}" placeholder="会员的常用QQ号码" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
				  <div class="layui-form-item">
				    <label class="layui-form-label">门店编号</label>
				    <div class="layui-input-inline">
				      <input type="text" name="branch_no" value="{$one['branch_no']}" placeholder="会员在那家门店注册的门店编号" autocomplete="off" class="layui-input">
				    </div>
				  </div>
				  
        		<input name="uid" type="hidden" value="{$one['uid']}"/>
            </div>
        </div>
    </div>
    <div class="bottom">
        <div class="button-container">
            <button type="submit" class="pear-btn pear-btn-primary pear-btn-sm" lay-submit="" lay-filter="user-save">
                <i class="layui-icon layui-icon-ok"></i>
                提交
            </button>
            <button type="reset" class="pear-btn pear-btn-sm">
                <i class="layui-icon layui-icon-refresh"></i>
                重置
            </button>
        </div>
    </div>
</form>
<script src="__STATIC__/lib/layui/layui.js"></script>
<script src="__PEAR__/component/pear/pear.js"></script>
<script>
layui.use(['form','jquery'],function(){
    let form = layui.form;
    let $ = layui.jquery;
    var path="/{$MODULE_NAME}/Member";
	var _url="/save";

    form.on('submit(user-save)', function(data){
    	
        $.ajax({
            url:path+_url,
            data:JSON.stringify(data.field),
            dataType:'json',
            contentType:'application/json',
            type:'post',
            success:function(result){
                if(result.code){
                    layer.msg(result.msg,{icon:1,time:1000},function(){
                        parent.layer.close(parent.layer.getFrameIndex(window.name));//关闭当前页
                        parent.layui.table.reload("member-table");
                    });
                }else{
                    layer.msg(result.msg,{icon:2,time:1000});
                }
            }
        })
        return false;
    });
})
</script>
<script>
</script>
</body>
</html>